<template>
    <div>
       <h1>门店信息列表展示</h1>
       <table class="table">
        <thead>
            <tr>
                <td>门店名称</td>
                <td>门店数量</td>
                <td>门店图片</td>
                <td>电话</td>
                <td>地址</td>
                <td>创建时间</td>
                <td>操作</td>
            </tr>
        </thead>
        <tbody>
            <tr v-for="a in data">
                <td>{{a.name  }}</td>
                <td>{{ a.num }}</td>
                <td> <img :src="'https://localhost:7185'+a.img" style="width: 100px;height: 100px;"></td>
                <td>{{a.phone  }}</td>
                <td>{{a.addr  }}</td>
                <td>{{moment(a.createTime).format("YYYY-MM-DD")  }}</td>
                <td> <input type="button" value="编辑" @click="UptMember(a.id)"></td>
            </tr>
        </tbody>
       </table>
    </div>
</template>

<script setup lang="ts">
import {ref,onMounted} from "vue"
import axios from "axios";
import moment from "moment";
import { useRouter } from "vue-router";
const router=useRouter()
const UptMember=(val:any)=>{
      router.push({path:"/UptView",query:{id:val}})
}
const data=ref([{
    "id": 1,
    "name": "",
    "num": 0,
    "img": "",
    "phone": "",
    "addr": "",
    "createTime": "2025-04-29T09:44:16.3623041"
}])
onMounted(()=>{
    Show();
})
const Show=()=>{
    axios.get("https://localhost:7185/api/Member/GetMember").then(res=>{
        data.value=res.data
    })
}
</script>

<style scoped>

</style>